@svizzle/dev/log/array-[any-any]

Methods

(static) tapWith() → {function}

Source:
Since:
  • 0.3.0

Return a function that prints a message with the result of applying the provided function to the input and return the input.

Example
> doubleTriple = filepath => _.pipe([
	mapWith(x => 3 * x),
	saveObjPassthrough(filepath)
	tapWith([arraySum, `Saved tripled items in ${someFilepath} – total`]),
	mapWith(x => 2 * x),
])
> fn = doubleTriple('foo/bar.json')
> fn([1, 2, 3])
[6, 12, 18]
'Saved tripled items in foo/bar.json – total: 18'
Parameters:
Type Description
array

[function, label]

Returns:
  • (Any -> Any) - @sideEffects: console.log
Type
function